/**
 *
 */
package com.csun.cmny.provider.service;

import com.csun.cmny.core.support.IService;
import com.csun.cmny.provider.dto.Group;
import com.csun.cmny.provider.dto.NursingBindRoomDto;
import com.csun.cmny.provider.model.dto.user.OmcUserQueryDto;
import com.csun.cmny.provider.model.vo.OmcUserVo;
import com.csun.cmny.provider.pojo.Bed;
import com.csun.cmny.provider.pojo.NursingGroup;
import com.csun.cmny.provider.pojo.Room;
import com.csun.cmny.provider.pojo.User;
import com.csun.cmny.provider.vo.NurseHomeVo;
import com.csun.cmny.provider.vo.NursingGroupBind;
import com.csun.cmny.provider.vo.NursingGroupVo;
import com.csun.cmny.provider.vo.OmcUserDetailVo;

import java.util.List;

/**
 * @author liqian
 * @date 2018年4月2日
 * @time 上午9:53:11
 * Description :
 */
public interface OmcGroupService extends IService<NursingGroup> {

    //通过id删除护工组
    public int deleteById(Long groupId);

    //插入一个护工组
    public int insert(Group group);

    //护工组绑定护工
    public int insertNursingGroupBind(List<User> list);

    //通过groupId修改护工组信息
    public int updateById(Group group);

    //通过护工组名称查重
    public int selectByName(Group group);

    //通过护工组名称或者组织ID查询护工组信息及护工的userId
    public List<NursingGroupVo> selectListByName(Group group);

    //根据buildingId查询没有被分配的房间
    public List<Room> selectByBuildingId(Long buildingId);

    //根据护工组ID查询绑定的护工
    List<OmcUserVo> selectByGroupId(Long groupId);

    //根据机构ID查询未绑定的护工
    List<OmcUserVo> selectUnUnrsingUserListByGroupId(Group group);

    //通过护工组Id或者护工Id查询是否有绑定护工组
    List<NursingGroupBind> selectNursingGroupBind(Group group);

    //查询所有护工组及其班长信息
    public List<NursingGroupVo> selectShowAll(Group group);

    //通过护工组名称和机构id查询护工组护工详细信息
    List<NursingGroupVo> selectNursingListByName(Group group);

    //删除护工组绑定护工
    int deleteNursingGroupBind(Group group);

    //护工组绑定房间
    int insertNursingRoomBind(List<Room> list);

    //通过护工组ID或者楼栋ID查询楼栋房间集合
    List<Room> selectForBuilding(Group group);

    //批量删除护工组绑定的房间
    int deleteNursingRoomBind(List<Room> list, Long nursingGroupId);

    //根据护工组ID查询被绑定的房间
    List<Room> selectNursingBindRoom(Long nursingGroupId);

    //根据房间Id查询床位信息
    List<Bed> selectByRoomId(Long roomId);

    //根据userId查询nursingGroupId
    Long selectNuringGroupIdByUserId(Long userId);

    //查询userId集合中已绑定护工组的护工
    List<OmcUserVo> isNursingbind(List<Long> userList);

    /**
     * 根据用户ID查询用户详情
     * @param userId 用户ID
     * @param groupId 组织机构ID
     * @return
     */
    OmcUserDetailVo queryUserDetail(Long userId,Long groupId);

    /**
     * 返回不是护工角色的用户
     * @param omcUserQueryDto
     * @return
     */
    List<Long> isNotNursing(OmcUserQueryDto omcUserQueryDto);

    /**
     * 护工调换角色时,删除用户绑定的护工 -- 若用户是班长不予删除
     * @param userId
     * @return
     */
    Integer deleteNursingUserBind(Long userId);

    /**
     * 根据userId查询护工班组信息
     * @param: [userId]
     * @return: com.csun.cmny.provider.model.vo.OmcUserVo
     */
    OmcUserVo getUserNursingGroupInfo(Long userId);

    /**
     * 根据班组Id修改该班组班长
     *
     * @param group the group
     *
     * @return  the int.
     */
    int updateUserIdByGroupId(Group group);

    /*
     * 大数据平台健康占比亚健康展示
     * */
    NurseHomeVo selectByNursingHome(Long groupId);
    /**
     * 护工绑定房间
     */
    Integer nursingBindRoom(NursingBindRoomDto nursingBindRoomDto);

    void deleteByUserId(List<Long> userIds);
    //护工绑定护工组
    void nursingBindNursingGroup(NursingBindRoomDto nursingBindRoomDto);

    void deleteByNursingGroupId(NursingBindRoomDto nursingBindRoomDto);
}
